package com.share.example.json2flat.init;

import com.share.example.json2flat.service.IMappingConfService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Slf4j
@Component
public class Init {
    @Autowired
    private IMappingConfService mappingConfService;

    @PostConstruct
    @Scheduled(cron = "0 0/5 * * * ?")
    public void initMappingConf() {
        log.info("---正在初始化-mappingConfService---");
        mappingConfService.init();
    }
}
